<?php

function smarty_block_access($params, $content, &$smarty, $open) {
	if (!$open){
		$simple = false;
		$key = '';
		$default = '';

		if (!empty($params['simple']))
		{
			$simple = true;
		}	
		
		if (isset($params['default']))
		{
			$default = $params['default'];
		}	
		
		if ($simple && !empty($params['key'])){
			$key = $params['key'];
		}else{	
			$key = $smarty->_tpl_vars['request']['controller'].(!empty($params['key'])?'-'.$params['key']:'');
		}
		
	    $p = $smarty->_tpl_vars['currentAccess'];
	    
	    //print($p[$key]);
	    
	   // if($key && !empty($p[$key])){
	        echo $content;
	   // }else{
	   // 	echo $default;
	   // }
	}
}

?>